package com.yikome.uaa.repository;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.yikome.common.CommonRepository;
import com.yikome.uaa.domain.User;

@Repository
public interface UserRepository extends CommonRepository<User, Long> {

	@Query("select t from User t where t.yn = 1 and t.username = :username")
	User findUser(@Param("username")String username);

	@Query("select t from User t where t.yn = 1 and t.id = :userId")
	User findUser(@Param("userId")Long userId);

	@Query("select t from User t where t.yn = 1 and t.username = :username and t.password = :password")
	User findUser(@Param("username")String username, @Param("password")String password);
}
